﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

using TierApplication;

namespace BasisMgr
{
    public partial class frmRoleDetail : TierService.frmTemplate
    {
        public string _RoleName;
        public string _IsFeeData;
        public string _IsAllUser;
        public string _IsBuyFee;
        public string _IsSaleFee;
        public frmRoleDetail()
        {
            InitializeComponent();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        private void btnModify_Click(object sender, EventArgs e)
        {
            if (txtRoleName.Text == "")
            {
                MessageBox.Show("请输入角色名称!");
                txtRoleName.Focus();
                return;
            }
            _RoleName = txtRoleName.Text;
            if (ckbIsFeeData.Checked)
                _IsFeeData = "1";
            if (ckbIsAllUser.Checked)
                _IsAllUser = "1";
            if (ckbIsBuyFee.Checked)
                _IsBuyFee = "1";
            if (ckbIsSaleFee.Checked)
                _IsSaleFee = "1";
            DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void frmRoleDetail_Load(object sender, EventArgs e)
        {
            txtRoleName.Text = _RoleName;

            P_Role mRole = new P_Role();
            ckbIsFeeData.Checked = _IsFeeData == "1";
            ckbIsAllUser.Checked = _IsAllUser == "1";
            ckbIsBuyFee.Checked = _IsBuyFee == "1";
            ckbIsSaleFee.Checked = _IsSaleFee == "1";
            
        }
    }
}